import wx
from wx.lib.hyperlink import HyperLinkCtrl

##  Displays information concerning the application in a dialog
class AboutDialog(wx.Dialog):
    ##  The constructor of AboutDialog. GUI elements of the dialog are setup here.
    #   @param[in]  gui     GUI instance.
    #   @param[in]  **kwds  Automatically passed parameter.
    def __init__(self, gui, **kwds):
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, gui, **kwds)
        
        image = wx.StaticBitmap(self, -1, wx.Bitmap("Images/About.png", wx.BITMAP_TYPE_PNG))
        tudelft = HyperLinkCtrl(self, wx.ID_ANY, "www.tudelft.nl", URL="http://www.tudelft.nl/")
        lumc = HyperLinkCtrl(self, wx.ID_ANY, "www.lumc.nl", URL="http://www.lumc.nl/")
        okButton = wx.Button(self, wx.ID_OK)

        # Set Properties
        self.SetTitle("About Flock of Birds Visualizer")
        self.SetIcon(wx.Icon(gui.main.config.root+"\\Images\\icon.ico", wx.BITMAP_TYPE_ICO, 32, 32))

        # Do Layout
        wrapperSizer = wx.FlexGridSizer(3, 1, 0, 0)
        hyperlinkSizer = wx.GridSizer(1, 2, 0, 0)
        wrapperSizer.Add(image, 0, 0, 0)
        hyperlinkSizer.Add(tudelft, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        hyperlinkSizer.Add(lumc, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        wrapperSizer.Add(hyperlinkSizer, 1, wx.ALL|wx.EXPAND, 5)
        wrapperSizer.Add(okButton, 0, wx.ALL|wx.ALIGN_RIGHT, 5)
        self.SetSizer(wrapperSizer)
        wrapperSizer.Fit(self)
        self.Layout()
        self.Centre()